package com.zzy.factory;
import com.zzy.card.creditCard;
import com.zzy.card.MasterCC;
import com.zzy.com.google.gson.Gson;
public class MasterFactory implements Factory{
	// 单例
    private static MasterFactory masterFactory = null;
    private MasterFactory() {
    }
    public static MasterFactory getFactory() {
        if (masterFactory == null) {
            masterFactory = new MasterFactory();
        }
        return masterFactory;
    }

	@Override
	public creditCard build(String line) {
		// TODO Auto-generated method stub
		Gson gson = new Gson();
        MasterCC shortdata = gson.fromJson(line, MasterCC.class);
        return shortdata;
	}

	@Override
	public creditCard build2() {
		// TODO Auto-generated method stub
		creditCard creditCard = new MasterCC();
        return creditCard;
	}

}
